<%--
  Created by IntelliJ IDEA.
  User: c
  Date: 2017-11-21
  Time: 10:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>采购计划审核明细信息</title>
    <%@include file="/WEB-INF/jsp/header.jsp"%>
</head>
<style>
    table td{
        font: 14px 'microsoft yahei', 微软雅黑, Helvetica, Arial, Tahoma, 黑体, 宋体, sans-serif;
    }
    div.title-pur p{
        margin-top: 10px;
        margin-bottom: 10px;
    }
</style>
<script src="${ctx}/statics/js/jquery-1.12.4.js"></script>
<body>
    <div class="container-fluid">
        <div style="text-align: center;margin-bottom: 10px;">
            <span class="h3">审核采购明细信息</span>
        </div>
       <div style="height: 35px; background-color: #F9F9F9; margin-top: 15px;">
           <label style="line-height: 35px; margin-left: 30px;"><i class="layui-icon" style="color: red;">&#xe623;</i>&nbsp;药品采购申请信息</label>
       </div>
        <div class="container-fluid" style="width: 85%;">
            <div style="font-size: 16px; margin-top: 15px;" class="row">
                <div class="col-md-4 title-pur">
                    <p><label>NO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;：</label>&nbsp;${pur.planNum}</p>
                    <p><label>供应商：</label>&nbsp;${pur.provider.proName}</p>
                </div>
                <div class="col-md-4 title-pur">
                    <p>
                        <fmt:formatDate value="${pur.planSubdate}" var="date" pattern="yyyy年MM月dd日"/>
                        <label>计划提交日期：</label>&nbsp;${date}
                    </p>
                    <p>
                        <fmt:formatDate value="${pur.planDate}" var="date" pattern="yyyy年MM月dd日"/>
                        <label>计划采购日期：</label>&nbsp;${date}
                    </p>
                </div>
                <div class="col-md-4 title-pur">
                    <p><label>采购员：</label>&nbsp;${pur.worker.woName}</p>
                </div>
            </div>
            <div style="font-size: 15px;">
                <p>
                    <label class=" pull-right"><span style="color: red;">审核状态：</span>
                        <span>${pur.planChstate==0?'待审核':pur.planChstate==1?'已通过':'未通过'}</span>
                    </label>
                </p>
            </div>
            <table id="delTable" class="table table-bordered ">
                <tr class="back">
                    <th rowspan="2" class="text-center">
                        <span style="line-height: 73px;">序号</span>
                    </th>
                    <th colspan="4" class="text-center">
                        药品信息
                    </th>
                    <th colspan="2">
                        库存信息
                    </th>
                    <th colspan="2" class="text-center">
                        价格(人民币:元)
                    </th>
                </tr>
                <tr class="back">
                    <th >药品名称</th>
                    <th >规格</th>
                    <th >购进数量</th>
                    <th >单位</th>
                    <th>现有库存</th>
                    <th>库存下限</th>
                    <th >单价(元)</th>
                    <th >小计</th>
                </tr>
                <c:forEach items="${list}" var="p">
                    <tr>
                        <td>${p.delId}</td>
                        <td>${p.druginfo.drugName}</td>
                        <td>${p.druginfo.drugStandard}</td>
                        <td class="delBuynum">${p.delBuynum}</td>
                        <td>${p.druginfo.drugUnit}</td>
                        <td>
                            ${p.druginfo.stockView.totalStock==null?'0':p.druginfo.stockView.totalStock}
                        </td>
                        <td>${p.druginfo.drugFloor}</td>
                        <td>${p.delOneprice}</td>
                        <td class="money" style="color: red;">
                            ￥<span><fmt:formatNumber type="number" value="${p.delBuynum*p.delOneprice}" pattern="0.00" maxFractionDigits="2"/></span>
                        </td>
                    </tr>
                </c:forEach>
                <tr>
                    <th colspan="3" style="text-align: right;">合计数量及金额：</th>
                    <th>
                        <span id="num"></span>
                        <script>
                            var totalNum=0;
                            $("table#delTable td.delBuynum").each(function(){
                                totalNum+=parseInt( $(this).html());
                            });
                            $("span#num").html(totalNum)
                        </script>
                    </th>
                    <th colspan="4"></th>
                    <th>
                        <span id="totalMo"></span>
                        <script>
                            var totalMoney=0.00;
                            $("table#delTable td.money").each(function(){
                                totalMoney+=parseFloat( $(this).find("span").html());
                            });
                            $("span#totalMo").html("￥"+totalMoney)
                        </script>
                    </th>
                </tr>
            </table>
        </div>
        <div style="height: 35px; background-color: #F9F9F9; margin-top: 25px;">
            <label style="line-height: 35px; margin-left: 30px;"><i class="layui-icon" style="color: red;">&#xe623;</i>&nbsp;审核信息</label>
        </div>
        <div class="container-fluid" style="width:85%;">
            <form class="form-horizontal auditInfo">
                    <input type="hidden" name="planNum" value="${pur.planNum}"/>
                    <div class="form-group">
                        <label for="" class="control-label col-md-2">
                            审核结果：

                        </label>
                        <c:if test="${pur.planChstate==2}">
                            <div class="form-group col-md-1">
                                 <label style="color: red;" class="control-label">
                                        未通过
                                </label>
                            </div>
                        </c:if>
                        <div class="form-group col-md-3">
                            <select class="form-control" name="planChstate" >
                                <option value="-1">--请选择--</option>
                                <option value="1">审核通过</option>
                                <option value="2">审核不通过</option>
                            </select>
                        </div>
                        <p class=" col-md-4" style="line-height: 34px; ">
                            <i style="color: red;">*</i>
                            <span style="color: red;" id="error"></span>
                        </p>
                    </div>
                <div class="form-group">
                    <label for="" class="control-label col-md-2">审核意见：</label>
                    <div class="form-group col-md-9">
                        <textarea placeholder="审核意见" class="layui-textarea" name="planViews">${pur.planViews}</textarea>
                    </div>
                </div>
                <div class="text-center">
                    <button type="button" class="btn btn-success baocun" onclick="baocun()"><i class="glyphicon glyphicon-share"></i>&nbsp;保存</button>&nbsp;&nbsp;&nbsp;
                    <button type="button" class="btn btn-primary fanhui" onclick="fanhui()"><i class="glyphicon glyphicon-repeat"></i> &nbsp;返回</button>
                </div>
            </form>
        </div>
    </div>
    <%@include file="/WEB-INF/jsp/footer.jsp"%>
    <script src="${ctx}/res/js/puraudit.js"></script>
</body>
</html>
